<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      /* #box {
        width: 100%;
        margin: 0 auto;
      }
      .pc {
        text-align: center;
      } */
      .div_color {
        width: 100px;
        height: 100px;
      }
      div {
        width: 300px;
        height: 100px;
      }
    </style>
  </head>
  <body>
    <!-- <div id="box">
      <p>梁朝伟</p>
      <p class="pc">的大哥</p>
      <p class="pc">是我</p> -->
    <!-- <button id="btn">点击</button>
      <div class="div_color"></div>
    </div> -->
    <div></div>
    <script>
      // var div_color = document.querySelector(".div_color");
      // btn.onclick = function () {
      //   var color_random =
      //   "rgb(" +
      //   Math.floor(Math.random() * 256) +
      //   "," +
      //   Math.floor(Math.random() * 256) +
      //   "," +
      //   Math.floor(Math.random() * 256) +
      //   ")";
      //   div_color.style.backgroundColor = color_random;
      // };
      var now = new Date();
      var timeTmp = now.toLocaleTimeString();
      var Div = document.querySelector("div");
      Div.innerHTML = timeTmp;

      // var pc = document.querySelectorAll(".pc");
      // var pc1 = document.querySelector(".pc");
      // console.log(pc);
      // console.log(pc1);
      // console.log(pc[1]);
      // document.write(pc1);
      // document.write(pc[1]);
      // document.write(pc1.innerHTML);
      // document.write(pc[1].innerHTML);
    </script>
  </body>
</html>
